<?php
include "../../config/ini.php";

$acceptFunctions = Array(	"newTask",
							"getTasks",
							"saveTask",
							"editTask",
							"viewTask",
							"deleteTask",
							"changeSprintTask",							
							"setTaskOrder",
							"changeOrder",
							"addAttach",
							"saveAttach",
							"deleteAttach",
							"getKanban",
							"changeStateTask",
							"getTasksStates",
							"deleteTaskState",
							"editTaskState",
							"newTaskState",
							"saveTaskState",
							"changeOrderTaskState",
							"setGoingTask",
							"saveGoingTask",
							"viewGoingTask",
							"deleteTaskGoing"
						);

preg_match("(^[a-zA-Z]+$)",$_GET['f'],$match);

if(count($match) > 0)
	$nameFunction = $match[0];

if(in_array($nameFunction,$acceptFunctions)){
	parse_str($_SERVER['QUERY_STRING'], $obj);
	unset($obj["f"]);
	echo C_Task::$nameFunction($obj);
}else{
	echo "Erro!";
}
?>